package com.justnow.order;

/**
 * @author justnow
 * Created on 2020-09-29
 * Description
 */
public class Test2 {
    public static void main(String[] args) {
        Son son = new Son();
    }
}

class Father {

    static {
        System.out.println("我是Father的静态代码块儿");
    }


    private static int i = get();


    {
        System.out.println("我是Father的代码块儿");
    }

    public Father() {
        System.out.println("我是Father的构造方法");
    }

    public static int get() {
        System.out.println("我是Father的get方法");
        return 0;
    }


}

class Son extends Father{
    private static int i = get();
    {
        System.out.println("我是Son的代码块儿");
    }

    static {
        System.out.println("我是Son的静态代码块儿");
    }


    public Son() {
        System.out.println("我是Son的构造方法");
    }

    public static int get() {
        System.out.println("我是Son的get方法");
        return 1;
    }
}
